/**
 * Created by Anard on 2017/4/5.
 */
let mysql = require('./mysql.js');
let path = require('./path.js');
let server = require('./server.js');
let blued = require('./blued.js');
let weixin = require('./weixin.js');
let variableKey = 'pro';

let variable = module.exports;

// 大厅服务器
variable.mysql = mysql[variableKey];
// 路径设置
variable.path = path[variableKey];
// blued相关
variable.blued = blued;
// weixin相关
variable.weixin = weixin;
// http服务器
variable.http = server[variableKey].http;
// 内存进程
variable.dc = server[variableKey].dc;
// gate
variable.gate = server[variableKey].gate;
// 登陆服务器
variable.enter = server[variableKey].enter;
// 匹配服务器
variable.match = server[variableKey].match;
// 游戏服务器
variable.game = server[variableKey].game;
variable.gameIdx = getIdx(server[variableKey].game);
// 功能服务器
variable.func = server[variableKey].func;
// 活动服务器
variable.activity = server[variableKey].activity;


function getIdx(array) {
    let idx = {};
    for (let i in array) {
        idx[array[i].id] = i;
    }
    return idx;
}

mysql = null;
path = null;
server = null;
blued = null;
weixin = null;